import java.security.*;
import java.util.*;
import javax.net.*;
import javax.net.ssl.*;
import java.io.*;

  public class EM_ServerThread extends Thread {

    public void run() {
        final int EM_port = 4444;
        boolean listening = true;
        SSLConection ConexioSegura = new SSLConection(EM_port, "em.private", "vm.public", "empass");
        try{
          SSLServerSocket server = ConexioSegura.getSSLServerSocket();
            
          while (listening){
            new EM_MultiServerThread(server.accept()).start();
          }
          server.close();
	}
        catch (Exception e) {
	    e.printStackTrace();
            System.err.println("Could not listen on port: "+EM_port);
            System.exit(-1);
        }
    }
  }